//
//  SpecialDetailCell.swift
//  OverseasOnlineShopping
//
//  Created by 唐先才 on 16/3/9.
//  Copyright © 2016年 唐先才. All rights reserved.
//

import UIKit

class SpecialDetailCell: UITableViewCell {

    @IBOutlet weak var iconView: UIImageView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        iconView.layer.cornerRadius = 10
        iconView.clipsToBounds = true
    }

    var model: TxcModel? {
        didSet {
            guard let pic = model?.strSpecialImage else {
                return
            }
            iconView.sd_setImageWithURL(NSURL(string: pic))
        }
    }
    
    class func specialCellWith(tablView: UITableView, indexPath: NSIndexPath, dataArray: NSMutableArray) ->UITableViewCell {
        if let specialDetailCell = tablView.dequeueReusableCellWithIdentifier("specialDetailCell") as? SpecialDetailCell {
            if dataArray.count > 0 {
                if let data = dataArray[indexPath.row] as? TxcModel {
                    specialDetailCell.model = data
                }
            }
            return specialDetailCell
        }
        return UITableViewCell()
    }
    
    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

    }
    
}
